<template>
  <div class="container">
  <img :src="backgroundImg" class="backgroundImg"/>
    <div class="btn">
      <div>
        <navigator open-type="navigate" url="../customer/main">
          <img :src="joinBtn" mode="aspectFit"/>
        </navigator>
      </div>
    </div>
    <div class="ucenter">
          <navigator url="../personal/main">
            <img src="http://file.loveciy.net/web/cut/icon-ucenter.png" class="customer"/>
          </navigator>
    </div>
    <div class="customerWrap">
          <navigator url="../customer/main">
            <img src="http://file.rzkeji.com/web/loveciy/img/customer.png" class="customer"/>
          </navigator>
      </div>
  </div>
</template>

<script>
export default {
  data () {
    return {

    }
  },
  computed:{
    backgroundImg(){
      return 'http://file.rzkeji.com/web/loveciy/img/join/joinBackground.jpg?d='+Math.random()*10;
    },
    joinBtn(){
      return 'http://file.rzkeji.com/web/loveciy/img/join/joinBtn.png?d='+Math.random()*10;
    }
  },
  onShareAppMessage: function (res) {   //分享
    this.$currency.share(res,'加入我们页面分享','/pages/contact/main')
  },
  onLoad () {
    var _this=this;
    var userToken=wx.getStorageSync('userToken')    
    _this.$request.getData("https://zlz.loveciy.net/api/ucenter/get-userinfo",{user_token:userToken}).then(res =>{
      var res=res.data.data;
      if(res.is_agent==1)
      {
        wx.redirectTo({
          url:"../joinDetails/main"
        })
      }
    })
  }
}
</script>

<style scoped>
  .container{width:100%;height: 100%;position: relative;overflow: hidden;}
  .backgroundImg{width: 100%;height: 100%;}
  .btn{width: 100%;height: 70px;position: absolute;bottom: 0;}
  .btn div{width: 100%;height: 100%;position: relative;}
  .btn div img{width: 100%;height: 100%;position: absolute;left:0;top:0;}
  .btn div span{width: 100%;height: 100%;position: absolute;left:0;top:0;text-align: center;line-height: 50px;font-size: 16px;}
  .customerWrap{width: 50px;height: 50px;position: fixed;right: 20px;bottom: 20px;background: rgba(0,0,0,0.5);border-radius: 50px;}
.customer{width:40px;height:40px;margin-left:5px;margin-top:5px;}
.ucenter{width: 50px;height: 50px;position: fixed;right: 20px;bottom: 80px;background: rgba(0,0,0,0.5);border-radius: 50px;}
</style>
